home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / scope / 176-200 / scopedisk189 / diskcache / cache-disk.doc < prev    next >
Text File  |  1995-03-19  |  9KB  |  214 lines

  1.                         Cache-Disk
  2.                         ----------
  3. License Agreement
  4. -----------------
  5.     Cache-Disk and the entire contents of the archive it came in 
  6. are (C) copyrighted 1991 by Terry Fisher.  You may not use, 
  7. modify, or distribute them except as expressed by this license 
  8. agreement.
  9.  
  10.     You may not disassemble, reverse engineer, or in any way 
  11. modify the programs contained in the archive.  
  12.  
  13.     Cache-Disk is distributed as shareware.  Permission is 
  14. granted to distribute Cache-Disk provided
  15.  
  16.     1)  the entire contents of the archive it came in are 
  17.         distributed with it.
  18.  
  19.     2)  it is not uploaded to any bulletin board services that 
  20.         claim ownership of the all uploaded software.
  21.  
  22.     3)  it is not distributed for profit without my written 
  23.         permission.
  24.  
  25.     4)  if it is included in any collection of freely 
  26.         distributable software, the charge for the disk may not 
  27.         exceed twice the current rate charged by Fred Fish.  
  28.         Fred Fish is granted explicit permission to include the 
  29.         contents of the archive in his library of freely 
  30.         distributable software.
  31.  
  32.     5)  it is not distributed with any commercial program without 
  33.         my written permission.
  34.  
  35.  
  36.     If you try Cache-Disk and, after two weeks, decide to use 
  37. it, please become a registered user by sending a cheque or money
  38. order for $25 to:
  39.  
  40.     Terry Fisher
  41.     102-401 Hazel St.
  42.     Waterloo, Ontario, Canada.
  43.     N2L 3P7
  44.  
  45.     Phone #: (519) 885-2785
  46.  
  47.     All registered users will receive one free upgrade.  See the 
  48. section on future improvements below.  Further upgrades will be 
  49. available at a cost of $5.
  50.  
  51. Introduction
  52. ------------
  53.     The Amiga's multi-tasking operating system makes the Amiga 
  54. one of the most flexible personal computers currently available.  
  55. Unfortunately, the power provided by this multi-tasking operating 
  56. system is greatly reduced when multiple processes try to access 
  57. resources such as the floppy disk drives simultaneously.  The 
  58. usual result of disk access by multiple processes is thrashing.  
  59. Almost everyone who owns an amiga has experienced this thrashing, 
  60. and until now have had to put up with it.  Now, Cache-Disk 
  61. reduces disk thrashing to a minimum.
  62.  
  63. How Cache-Disk Works
  64. --------------------
  65.     When a program requests a sector to be read from a floppy 
  66. disk, the Amiga's trackdisk.device always reads the entire track 
  67. containing the requested sector from the disk.  By performing 
  68. reads in this fashion, the trackdisk.device creates a miniature 
  69. cache in that if the next sector requested is on the same track, 
  70. no disk activity is required.  In most cases, files are stored 
  71. sequentially on the disk and the above cache provides a 
  72. significant optimization to disk access.
  73.  
  74.     Unfortunately, when two or more processes are reading from 
  75. the disk, the requests are rarely sequential.  Each disk read or 
  76. write requires the trackdisk.device to flush its single track 
  77. cache to read the track containing the data for the next read 
  78. request.  This freshly read track is often flushed almost 
  79. immediately, to recover the track that previously occupied the 
  80. cache.  As more processes are added to the cycle, the situation 
  81. becomes even worse.
  82.  
  83.     Cache-Disk patches the trackdisk.device and intercepts all 
  84. read and write operations.  Whenever cache-disk receives a 
  85. request for a sector on the disk, it requests that the 
  86. trackdisk.device read the entire track.  The contents of this 
  87. track are then placed in one of cache-disks buffers.  Any further 
  88. requests for data on this track are performed out of cache-disks 
  89. buffer.  If a request for another track is received, that entire 
  90. track is placed in another cache-disk buffer.  Now, access to 
  91. either of these tracks requires no activity.
  92.  
  93.     Since memory is often a limited resource, cache-disk lets 
  94. the user specify the number of buffers it should allocate for 
  95. each floppy disk drive.  Once all buffers have been filled, the 
  96. contents of the least recently used buffer are either written to 
  97. disk (if the buffer has been modified by a write operation), or 
  98. discarded to make room for a new track.  Substantial performance 
  99. increases can be realized from as few as two or three buffers, 
  100. but the more buffers made available to cache-disk, the more 
  101. noticeable the speed increase.
  102.  
  103.     Cache-Disk flushes modified buffers whenever it receives a 
  104. CMD_FLUSH command.  The Amiga automatically generates such a 
  105. request after approximately 2 seconds of disk inactivity.
  106.  
  107. A Few Benchmarks
  108. ----------------
  109.     The results of a few benchmarks to demonstrate the speed 
  110. increase realized by using cache-disk are listed below.  In all 
  111. cases, the benchmark was performed with the cache-disk buffers 
  112. empty.  Times were recorded without cache-disk installed, and 
  113. with cache-disk installed with 2, 5, 10, and 20 buffers.
  114.  
  115.     1)  Copying the Workbench disk.  The first of these 
  116.         benchmarks was the simple copying of the standard 
  117.         Workbench1.3 disk from drive 0 to a freshly formatted 
  118.         diskette in drive 1 using the AmigaDOS 'Copy' command.  
  119.         The same number of cache-disk buffers were used for 
  120.         source and destination disk drives.
  121.  
  122.     2)  File creation.  200 empty files were created on a freshly 
  123.         formatted diskette in drive 0.
  124.  
  125.     3)  Multi-process access.  To perform this test, a program 
  126.         which sequentially read each sector on the disk in drive 
  127.         0 was used.  This program, diskscan, and a batch file 
  128.         which was also used to perform the test can be found in 
  129.         the test subdirectory.
  130.  
  131.  
  132.     Cache-Disk     Test 1       Test 2      Test 3
  133.     Buffers       (seconds)    (seconds)   (seconds)
  134.     ----------    ---------    ---------   ---------
  135.        0            669           418        1004
  136.        2            594           419         180
  137.        5            307            62         174
  138.       10            295            48         174
  139.       20            276            30         123
  140.  
  141.  
  142. How to use Cache-Disk
  143. ---------------------
  144.     Cache-Disk may be run form either the Workbench or the CLI.  
  145. When run from the CLI, Cache-Disk accepts command line arguments 
  146. of the form dn=buffers where
  147.     n           is the drive number
  148.     buffers     is the number of buffers to allocate for this 
  149.                 drive.  Note that each buffer uses close to 6K 
  150.                 of chip memory.
  151.  
  152.     eg.  To use Cache-Disk with 5 buffers for drive 0 and 10 
  153. buffers for drive 2, the command is "Cache-Disk d0=5 d2=10".  
  154. Cache-Disk detaches from the CLI, so it is not necessary to "run" 
  155. it.
  156.  
  157.     To disable Cache-Disk once it has been executed, simply 
  158. execute it again.
  159.  
  160.     When running Cache-Disk from the Workbench, the number of 
  161. buffers is specified by using the "Info" menu item, and setting 
  162. tool types of the form "DRIVEn=buffers" where
  163.     n           is the drive number
  164.     buffers     is the number of buffers to allocate for this 
  165.                 drive.  Note that each buffer uses close to 6K 
  166.                 of chip memory.
  167.  
  168.     Cache-Disk is then enabled by double-clicking on its icon.  
  169. Double-clicking on its icon a second time causes Cache-Disk to 
  170. terminate.
  171.  
  172. Cache-Disk Features
  173. -------------------
  174.     - Buffers disk reads and writes for maximum speed gain.
  175.     - Detaches from the CLI, and can be run from the Workbench.
  176.     - Can be turned off by re-running the program.
  177.     - User setable number of buffers for each drive.
  178.     - Works with the Messy-Dos (MSH) File System (another 
  179.       wonderful piece of shareware software).
  180.  
  181. Known Problems
  182. --------------
  183.     - Uses precious chip memory.
  184.     - Does not support the AbortIO() function.
  185.     - Disabling Cache-Disk while there is disk activity may 
  186.       corrupt the diskette.  Always wait for disk activity to stop 
  187.       before disabling the cache.
  188.  
  189.  
  190.  
  191. Planned Enhancements (to be included in next release)
  192. -----------------------------------------------------
  193.     - Buffer allocation from Fast RAM.
  194.     - Support for hard-disks.
  195.     - More efficient flushing algorithm.
  196.     - Fix to support the AbortIO() function.
  197.  
  198.     If you find a problem with Cache-Disk which is not listed, 
  199. please inform me at the address given above.
  200.  
  201. Disclaimer
  202. ----------
  203.     I provide no warrantee, either written or expressed as to 
  204. the usability of Cache-Disk.  I am not responsible for any damage 
  205. or loss of data caused directly or indirectly by its use.
  206.  
  207. Trademarks/Copyrights
  208. ---------------------
  209. Amiga (tm) is a registered trademark of Commodore-Amiga Inc.
  210. AmigaDOS (tm) is a registered trademark of Commodore-Amiga Inc.
  211. Workbench (tm) is a trademark of Commodore-Amiga Inc.
  212. MSH (C) is copyright Olaf Seibert.
  213.  
  214.